package com.situ.mall.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class OrderDateNoUtil {
    public static Long getOrderNo() {
        // orderNo:使用当前的日期和时间 20200402093523
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
        int num = (int) (Math.random() * 10);
        String now = simpleDateFormat.format(date) + num;
        System.out.println(now);
        return Long.parseLong(now);
    }
}
